<script>
import {defineComponent} from 'vue'

export default defineComponent({
  name: "Status",
  created() {
    let code = Number(this.$route.query.code)
    if(!isNaN(code)){
      this.code = code
    }
    this.init()
  },
  data(){
    return {
      code: -1,
      msg: '异常错误'
    }
  },
  methods: {
    init(){
      switch (this.code){
        case -1: {
          this.msg = '异常错误，请稍后再试'
          break
        }
        case -3: {
          this.msg = '查询的对象不存在'
          break
        }
        case -4: {
          this.msg = '您没有此对象的操作权限'
          break
        }
      }
      console.log(this.code);
      console.log(this.msg);
    }
  }
})
</script>

<template>
  <van-empty image="error" :description="msg" />
</template>

<style scoped>

</style>